export default [
    {
        text: "今天的工作态度",
        weight() {
            if (this.period == "working" && !this.self.tags["strategy"]) {
                return 100
            }
            return 0
        },
        actions: [
            {
                text: "马马虎虎",
                hour: 0,
                cb() {
                    this.self.tags.strategy = 1;
                }
            },
            {
                text: "普普通通",
                hour: 0,
                cb() {
                    this.self.tags.strategy = 2;
                }
            },
            {
                text: "勤勤恳恳",
                hour: 0,
                cb() {
                    this.self.tags.strategy = 3;
                }
            }
        ]
    },
    {
        text: "摸了一会鱼",
        weight() {
            if (this.period == "working") {
                if (this.self.tags["strategy"] == 1) {
                    return 100
                } else if (this.self.tags["strategy"] == 2) {
                    return 50
                }
            }
            return 0
        },
        effects: [{
            weight() {
                return 100
            },
            cb() {
                this.self.happiness++
                return "感觉自己很快乐"
            }
        },
        {
            weight() {
                return 20
            },
            cb() {
                this.self.happiness -= 3
                var count = Math.ceil(this.self.salary / 10);
                this.self.wealth -= count;
                return `被老板发现，罚款${count}，感觉不会再快乐了`
            }
        }]

    },
    {
        text: "做了一会工作",
        weight() {
            if (this.period == "working") {
                if (this.self.tags["strategy"]) {
                    return 100
                }
            }
            return 0
        },
        effects: [{
            weight() {
                return 100
            },
            cb() {
                this.self.kpi += this.self.ability
                this.self.happiness--
                return "完成了一些kpi"
            }
        },
        {
            weight() {
                return 50
            },
            cb() {
                this.self.kpi += Math.floor(this.self.ability / 2)
                this.self.happiness -= 2
                return "遇到难题,进展缓慢"
            }
        },
        {
            weight() {
                return 20
            },
            cb() {
                this.self.kpi += this.self.ability * 2
                this.self.ability++
                return "灵感迸发,完成了大量kpi，感觉自己能力提升了"
            }
        }]

    },
    {
        text: "中午了，选择用午休时间",
        weight() {
            if (this.period == "lunch") {
                return 100
            }
            return 0
        },
        actions: [
            {
                text: "下馆子吃大餐",
                cb() {
                    this.self.wealth -= 50;
                    this.self.health += 2
                    this.self.happiness += 2
                }
            },
            {
                text: "边吃外卖边刷剧",
                cb() {
                    this.self.wealth -= 20;
                    this.self.health++
                    this.self.happiness++
                }
            },
            {
                text: "随便吃点继续工作",
                cb() {
                    this.self.wealth -= 10;
                    this.self.kpi += Math.floor(this.self.ability)
                    this.self.health--
                }
            }

        ]
    },
    {
        text: "已经是下班时间了",
        weight() {
            if (this.period == "after_work") {
                return 100
            }
            return 0
        },
        actions: [
            {
                text: "回家休息",
                hour: 14,
                cb() {
                    this.self.happiness += 5
                    this.self.health += 3
                    return "<div>吃了顿营养晚餐，娱乐了一会然后早早地休息了</div>"
                }
            },
            {
                text: "回家学习",
                hour: 14,
                cb() {
                    this.self.ability += 2
                    this.self.happiness += 1
                    return "<div>学习了新知识，感觉对工作更得心应手了</div>"
                }
            },
            {
                text: "加一会班",
                hour: 14,
                cb() {
                    this.self.kpi += Math.floor(this.self.ability)
                    return "<div>回家吃完外卖冲了个澡，时间就已经不早了</div><div>躺在床上玩了会手机就睡了</div>"

                }
            },
            {
                text: "加班到夜里",
                hour: 14,
                cb() {
                    this.self.kpi += Math.floor(this.self.ability * 3)
                    this.self.happiness -= 5
                    return "<div>回家的路上只有满天的星星陪伴着你</div>"
                }
            },
            {
                text: "通宵加班",
                hour: 14,
                cb() {
                    this.self.kpi += Math.floor(this.self.ability * 6)
                    this.self.health -= 5
                    this.self.happiness -= 10
                    return "<div>当你走出公司，新一天的太阳已经升起了</div>"
                }
            },
        ]

    },
    {
        text: "<br/>从睡梦中醒来，新的一天开始了",
        weight() {
            if (this.period == "before_work") {
                return 100
            }
            return 0
        },
        effects: [{
            weight() {
                return 100
            },
            cb() {
                delete this.self.tags["strategy"]

                var res = "";

                this.self.wealth += this.self.salary
                res += `<div>收到 ${this.self.salary} 元工资</div>`

                this.self.wealth -= 80;
                res += `<div>日常开支 80 元</div>`

                if (this.self.kpi < this.self.target_kpi) {
                    let count = Math.ceil((this.self.target_kpi - this.self.kpi) / 10);
                    this.self.salary -= count;
                    res += `<div>未能达成kpi，降薪 ${count} 元</div>`
                } else if (this.self.kpi > this.self.target_kpi) {
                    let count = Math.ceil((this.self.kpi - this.self.target_kpi) / 10);
                    this.self.salary += count;
                    res += `<div>超额达成kpi，涨薪 ${count} 元</div>`
                }

                this.self.target_kpi = Math.max(this.self.kpi, this.self.target_kpi) + this.self.salary * 4;


                if (this.self.happiness < 30) {
                    this.self.health -= Math.round((30 - this.self.happiness) / 10) * 2;
                    res += "<div>由于压力过大，感觉身体不适</div>"
                } else if (this.self.happiness > 70) {
                    this.self.health += Math.round((this.self.happiness - 70) / 10);
                    res += "<div>感觉自己精力充沛</div>"
                }

                res += "<br/>"
                return res
            }
        }]

    },

    {
        text: "周末准备做些什么?",
        weight() {
            if (this.period == "weekend") {
                return 100
            }
            return 0
        },
        actions: [
            {
                text: "外出购物",
                hour: 24,
                cb() {
                    this.self.happiness += 20;
                    this.self.wealth -= 160;
                }
            },
            {
                text: "在家休息",
                hour: 24,
                cb() {
                    this.self.happiness += 5;
                    this.self.health += 10;
                    this.self.wealth -= 80;
                }
            },
            {
                text: "在家学习",
                hour: 24,
                cb() {
                    this.self.happiness += 2;
                    this.self.ability += 6;
                    this.self.wealth -= 80;
                }
            },
            {
                text: "去公司加班",
                hour: 24,
                cb() {
                    this.self.happiness -= 10;
                    this.self.kpi += this.self.ability * 8;
                    this.self.ability += 4;
                    this.self.wealth -= 80;
                }
            },
        ]
    },
];